import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useBankCardStore = defineStore('bankCard', () => {
  // 银行卡列表
  const cards = ref([
    { bank: '中国工商银行', number: '622848******1234', type: '储蓄卡' },
    { bank: '中国建设银行', number: '621558******5678', type: '储蓄卡' }
  ])

  // 添加银行卡
  function addCard(card) {
    cards.value.push(card)
  }

  // 移除银行卡
  function removeCard(idx) {
    cards.value.splice(idx, 1)
  }

  return { cards, addCard, removeCard }
}) 